package cn.fl.syssms.controller;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.poi.hssf.util.HSSFColor;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;

import cmm.comm.facade.upload.constant.SysUlFilesRecConstant;
import cmm.mid.core.framework.dto.DataResultDTO;
import cmm.mid.core.framework.page.DataResultVO;
import cmm.mid.core.framework.page.ListPageVO;
import cmm.mid.core.framework.page.Pager;
import cmm.web.core.framework.controller.BaseController;
import cn.cmm.base.framework.constant.BaseConstant;
import cn.cmm.base.framework.exception.BaseException;
import cn.cmm.base.framework.utils.BaseLogUtils;
import cn.cmm.base.framework.utils.CollectionUtils;
import cn.cmm.base.framework.utils.DateUtils;
import cn.cmm.base.framework.utils.StringUtils;
import cn.cmm.cache.framework.utils.PropertiesCacheUtils;
import cn.fl.framework.base.context.CurrentThreadContext;
import cn.fl.syssms.condition.SysSmsLogQueryCondition;
import cn.fl.syssms.constant.SysSmsLogConstant;
import cn.fl.syssms.dto.SysSmsLogDTO;
import cn.fl.syssms.service.ISysSmsLogService;
import cn.fl.syssms.transform.SysSmsLogVOTransform;
import cn.fl.syssms.vo.SysSmsLogVO;
import cn.fl.system.constant.SysLogConstant;
import cn.lb.framework.poi.excel.ExcelExportUtil;
import cn.lb.framework.poi.excel.entity.ExportParams;
import cn.lb.framework.poi.excel.entity.enmus.ExcelType;
import cn.lb.framework.poi.excel.export.styler.ExcelExportStylerDefaultImpl;

/**
 * @Description: 短信日志表 控制层
 */
@Controller
@RequestMapping("/syssms/sysSmsLog")
public class SysSmsLogController extends BaseController {

	private static final Logger logger = LoggerFactory.getLogger(SysSmsLogController.class);

	/**
	 * SysSmsLog 服务层BEAN
	 */
	@Autowired
	private ISysSmsLogService sysSmsLogService;

	/**
	 * 到短信管理页面
	 */
	@RequestMapping(value = "/toSysSmsManagePage.do", method = { RequestMethod.GET})
	public ModelAndView toSysSmsManagePage(HttpServletRequest request, HttpServletResponse response) {
		ModelAndView view = new ModelAndView("syssms/sysSmsLog/sysSmsManagePage");
		BaseLogUtils.info(logger, "toSysSmsManagePage", "跳转到列表页面.", CurrentThreadContext.getCurrentUserName());
		return view;
	}

	/**
	 * 到发送短信页面
	 */
	@RequestMapping(value = "/toSendSmsPage.do", method = { RequestMethod.GET})
	public ModelAndView toSendSmsPage(HttpServletRequest request, HttpServletResponse response) {
		ModelAndView view = new ModelAndView("syssms/sysSmsLog/sysSmsSendSms");
		BaseLogUtils.info(logger, "toSendSmsPage", "跳转到列表页面.", CurrentThreadContext.getCurrentUserName());
		return view;
	}
	/**
	 * 到批量发送页面
	 */
	@RequestMapping(value = "/toBatchSendSmsPage.do", method = { RequestMethod.GET})
	public ModelAndView toBatchSendSmsPage(HttpServletRequest request, HttpServletResponse response) {
		ModelAndView view = new ModelAndView("syssms/sysSmsLog/sysSmsBatchSendSms");
		BaseLogUtils.info(logger, "toSendSmsPage", "跳转到列表页面.", CurrentThreadContext.getCurrentUserName());
		return view;
	}
	/**
	 * 到预约记录页面
	 */
	@RequestMapping(value = "/toReserRecordPage.do", method = { RequestMethod.GET})
	public ModelAndView toReserRecordPage(HttpServletRequest request, HttpServletResponse response) {
		ModelAndView view = new ModelAndView("syssms/sysSmsLog/sysSmsReserRecord");
		BaseLogUtils.info(logger, "toSendSmsPage", "跳转到列表页面.", CurrentThreadContext.getCurrentUserName());
		return view;
	}
	/**
	 * 到发送历史页面
	 */
	@RequestMapping(value = "/toSendRecordPage.do", method = { RequestMethod.GET})
	public ModelAndView toSendRecordPage(HttpServletRequest request, HttpServletResponse response) {
		ModelAndView view = new ModelAndView("syssms/sysSmsLog/sysSmsSendRecord");
		BaseLogUtils.info(logger, "toSendSmsPage", "跳转到列表页面.", CurrentThreadContext.getCurrentUserName());
		return view;
	}

	/**
	 * 初始化预约记录列表
	 */
	@SuppressWarnings("unchecked")
	@RequestMapping(value = "/initReserRecordList.do", method = { RequestMethod.GET})
	@ResponseBody
	public Object initReserRecordList(HttpServletRequest request, HttpServletResponse response) {
		String currentPage = request.getParameter("page");
		String pageSize = request.getParameter("pagesize");
		String sendDateBegin = request.getParameter("sendDateBegin"); //开始时间
		String sendDateEnd = request.getParameter("sendDateEnd"); //结束时间
		String receivePhone = request.getParameter("receivePhone"); //手机号
		String contents = request.getParameter("contents"); //短信内容
		String createName = request.getParameter("createName"); //创建人

		Pager page = new Pager();
		if (StringUtils.isNotEmpty(currentPage)) {
			page.setCurrentPage(Integer.parseInt(currentPage));
		}

		if (StringUtils.isNotEmpty(pageSize)) {
			page.setEveryPage(Integer.parseInt(pageSize));
		}

		SysSmsLogQueryCondition qc = new SysSmsLogQueryCondition();
		if (StringUtils.isNotEmpty(sendDateBegin)) {
			qc.setSendDateBegin(DateUtils.formatStringToDate(sendDateBegin,"yyyy-MM-dd"));
		}
		if (StringUtils.isNotEmpty(sendDateEnd)) {
			qc.setSendDateEnd(DateUtils.formatStringToDate(sendDateEnd, "yyyy-MM-dd"));
		}
		if (StringUtils.isNotEmpty(receivePhone)) {
			qc.setReceivePhone(receivePhone);
		}
		if (StringUtils.isNotEmpty(contents)) {
			qc.setContents(contents);
		}
		if (StringUtils.isNotEmpty(createName)) {
			qc.setCreateName(createName);
		}
		qc.setSmsStatus("0");
		qc.setSendTask("001");
		page.setCondition(qc);

		Pager pager = this.sysSmsLogService.searchListPage(page);
		List<SysSmsLogVO> list = SysSmsLogVOTransform.toVOList((List<SysSmsLogDTO>)pager.getResultList());
		ListPageVO<SysSmsLogVO> listPage = new ListPageVO<SysSmsLogVO>(list, pager.getTotalCount());
		BaseLogUtils.info(logger, "initReserRecordList", "查询数据完成. DATA:" + JSONObject.toJSONString(page), CurrentThreadContext.getCurrentUserName());
		return listPage;
	}

	/**
	 * 初始化发送历史列表
	 */
	@SuppressWarnings("unchecked")
	@RequestMapping(value = "/initSendRecordList.do", method = { RequestMethod.GET})
	@ResponseBody
	public Object initSendRecordList(HttpServletRequest request, HttpServletResponse response) {
		String currentPage = request.getParameter("page");
		String pageSize = request.getParameter("pagesize");
		String sendDateBegin = request.getParameter("sendDateBegin"); //开始时间
		String sendDateEnd = request.getParameter("sendDateEnd"); //结束时间
		String receivePhone = request.getParameter("receivePhone"); //手机号
		String contents = request.getParameter("contents"); //短信内容
		String createName = request.getParameter("createName"); //创建人

		Pager page = new Pager();
		if (StringUtils.isNotEmpty(currentPage)) {
			page.setCurrentPage(Integer.parseInt(currentPage));
		}

		if (StringUtils.isNotEmpty(pageSize)) {
			page.setEveryPage(Integer.parseInt(pageSize));
		}
		SysSmsLogQueryCondition qc = new SysSmsLogQueryCondition();
		if (StringUtils.isNotEmpty(sendDateBegin)) {
			qc.setSendDateBegin(DateUtils.formatStringToDate(sendDateBegin,"yyyy-MM-dd"));
		}
		if (StringUtils.isNotEmpty(sendDateEnd)) {
			qc.setSendDateEnd(DateUtils.formatStringToDate(sendDateEnd, "yyyy-MM-dd"));
		}
		if (StringUtils.isNotEmpty(receivePhone)) {
			qc.setReceivePhone(receivePhone);
		}
		if (StringUtils.isNotEmpty(contents)) {
			qc.setContents(contents);
		}
		if (StringUtils.isNotEmpty(createName)) {
			qc.setCreateName(createName);
		}
		//qc.setSendTask("001");
		page.setCondition(qc);

		Pager pager = this.sysSmsLogService.searchListPage(page);
		List<SysSmsLogVO> list = SysSmsLogVOTransform.toVOList((List<SysSmsLogDTO>)pager.getResultList());
		if(CollectionUtils.isNotEmpty(list)){
			this.setSysSmsLogVOWithDicInfo(list);//加入字典项名称
		}
		ListPageVO<SysSmsLogVO> listPage = new ListPageVO<SysSmsLogVO>(list, pager.getTotalCount());
		BaseLogUtils.info(logger, "initSendRecordList", "查询数据完成. DATA:" + JSONObject.toJSONString(page), CurrentThreadContext.getCurrentUserName());
		return listPage;
	}
	/**
	 * 到列表页面
	 */
	@RequestMapping(value = "/toListPage.do", method = { RequestMethod.GET})
	public ModelAndView toListPage(HttpServletRequest request, HttpServletResponse response) {
		ModelAndView view = new ModelAndView("syssms/sysSmsLog/list");
		BaseLogUtils.info(logger, "toListPage", "跳转到列表页面.", CurrentThreadContext.getCurrentUserName());
		return view;
	}

	/**
	 * 到修改页面
	 */
	@RequestMapping(value = "/toModifyPage.do", method = { RequestMethod.GET, RequestMethod.POST })
	public ModelAndView toModifyPage(HttpServletRequest request, HttpServletResponse response) {
		String id = request.getParameter("id");
		ModelAndView view = new ModelAndView("syssms/sysSmsLog/modify");
		view.addObject("id", id);
		BaseLogUtils.info(logger, "toModifyPage", "跳转到修改页面.[id="+id+"]", CurrentThreadContext.getCurrentUserName());
		return view;
	}

	/**
	 * 初始化列表
	 */
	@SuppressWarnings("unchecked")
	@RequestMapping(value = "/initList.do", method = { RequestMethod.GET})
	@ResponseBody
	public Object initList(HttpServletRequest request, HttpServletResponse response) {
		String currentPage = request.getParameter("page");
		String pageSize = request.getParameter("pagesize");
		String searchName = request.getParameter("demo.name");
		Pager page = new Pager();
		if (StringUtils.isNotEmpty(currentPage)) {
			page.setCurrentPage(Integer.parseInt(currentPage));
		}

		if (StringUtils.isNotEmpty(pageSize)) {
			page.setEveryPage(Integer.parseInt(pageSize));
		}

		SysSmsLogQueryCondition qc = new SysSmsLogQueryCondition();
		if (StringUtils.isNotEmpty(searchName)) {
			//TODO SOMTHING
		}
		page.setCondition(qc);

		//TODO SOMETHING
		Pager pager = new Pager();//this.sysSmsLogService.searchListPage(page);
		List<SysSmsLogVO> list = (List<SysSmsLogVO>) pager.getResultList();
		ListPageVO<SysSmsLogVO> listPage = new ListPageVO<SysSmsLogVO>(list, pager.getTotalCount());
		BaseLogUtils.info(logger, "initList", "查询数据完成. DATA:" + JSONObject.toJSONString(page), CurrentThreadContext.getCurrentUserName());
		return listPage;
	}
	/**
	 * 设置关于字典项信息
	 * @param listVO
	 */
	private void setSysSmsLogVOWithDicInfo(List<SysSmsLogVO> listVO) {
		if(CollectionUtils.isEmpty(listVO))return;
		Map<String, String> smsStatusMap = this.sysSmsLogService.searchGroupToMap(CurrentThreadContext.getFlServiceSysCd(), CurrentThreadContext.getCurrentOrgCd(), SysSmsLogConstant.SMS_STATUS_CD);
		for (SysSmsLogVO sysSmsLogVO : listVO) {
			if(smsStatusMap.containsKey(sysSmsLogVO.getSmsStatus())){
				sysSmsLogVO.setSmsStatusNm(smsStatusMap.get(sysSmsLogVO.getSmsStatus()));
			}
		}
	}
	/**
	 * 删除多条数据
	 */
	@RequestMapping(value = "/removeByIds.do", method = {RequestMethod.POST })
	@ResponseBody
	public DataResultVO removeByIds(HttpServletRequest request, HttpServletResponse response) throws BaseException {
		String ids = request.getParameter("ids");
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_DELETE_SUCC);
		if(StringUtils.isEmpty(ids)){
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_DATA_PK_IS_EMPTY);
			BaseLogUtils.info(logger, "removeById", "删除数据,主键参数为空!", CurrentThreadContext.getCurrentUserName());
			return result;
		}
		List<Long> idsList = new ArrayList<Long>();
		JSONArray idsArray = JSONArray.parseArray(ids);
		for (Object object : idsArray) {
			idsList.add(Long.valueOf(object.toString()));
		}
		try {
			boolean success = this.sysSmsLogService.removeByIds(idsList);
			if(!success){
				result.setSuccess(BaseConstant.IS_YESNO_NO);
				result.setInfo(SysLogConstant.LOG_CMM_DELETE_FAIL);
				BaseLogUtils.info(logger, "removeById", "删除数据失败,ID:"+idsList.toString(), CurrentThreadContext.getCurrentUserName());
				return result;
			}
			BaseLogUtils.info(logger, "removeById", "删除数据.[id="+ids+"]", CurrentThreadContext.getCurrentUserName());
		}catch (BaseException ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "removeById", "删除数据失败.[id="+ids+"]"+ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}catch (Exception ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "removeById", "删除数据失败.[id="+ids+"]"+ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}

		return result;
	}

	/**
	 * 删除数据
	 */
	@RequestMapping(value = "/removeById.do", method = {RequestMethod.POST })
	@ResponseBody
	public DataResultVO removeById(HttpServletRequest request, HttpServletResponse response) throws BaseException {
		String id = request.getParameter("id");
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_DELETE_SUCC);
		if(StringUtils.isEmpty(id)){
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_DATA_PK_IS_EMPTY);
			return result;
		}
		try {
			this.sysSmsLogService.removeById(Long.valueOf(id));
			BaseLogUtils.info(logger, "removeById", "删除数据.[id="+id+"]", CurrentThreadContext.getCurrentUserName());
		}catch (BaseException ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "removeById", "删除数据失败.[id="+id+"]"+ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}catch (Exception ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "removeById", "删除数据失败.[id="+id+"]"+ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}

		return result;
	}

	/**
	 * 得到一条记录
	 * 
	 * @param request
	 * @return
	 * @throws Exception
	 */
	@RequestMapping(value = "/getById.do", method = { RequestMethod.GET})
	@ResponseBody
	public Object getById(HttpServletRequest request, HttpServletResponse response) throws BaseException {
		String id = request.getParameter("id");
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_OPERATE_SUCC);
		if(StringUtils.isEmpty(id)){
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_DATA_PK_IS_EMPTY);
			BaseLogUtils.error(logger, "getById", "获取数据,主键不存在.[id="+id+"]", CurrentThreadContext.getCurrentUserName());
			return result;
		}
		
		try {
			SysSmsLogVO vo = this.sysSmsLogService.selectById(Long.valueOf(id));
			if(null == vo){
				result.setSuccess(BaseConstant.IS_YESNO_NO);
				result.setInfo(SysLogConstant.LOG_CMM_QUERY_DATA_IS_EMPTY);
				BaseLogUtils.info(logger, "getById", "获取数据,数据不存在.[id="+id+"]", CurrentThreadContext.getCurrentUserName());
			}
			result.setData(vo);
			BaseLogUtils.info(logger, "getById", "获取数据.[id="+id+"]", CurrentThreadContext.getCurrentUserName());
		}catch(BaseException ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "getById", "获取失败.[id="+id+"]"+ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}catch(Exception ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "getById", "获取失败.[id="+id+"]"+ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}
		return result;
	}

	/**
	 * 新增
	 */
	@RequestMapping(value = "/add.do", method = { RequestMethod.POST })
	@ResponseBody
	public Object add(HttpServletRequest request, HttpServletResponse response) throws BaseException {
		String name = request.getParameter("name");
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_ADD_SUCC);
		SysSmsLogVO entity = null;
		try {
			entity = new SysSmsLogVO();
			Long id = this.sysSmsLogService.add(entity);
			result.setData(id);
			BaseLogUtils.info(logger, "add", "新增数据.[id="+id+"] DATA:" + JSONObject.toJSONString(entity), CurrentThreadContext.getCurrentUserName());
		}catch (BaseException ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "add", "新增数据失败.DATA:" + JSONObject.toJSONString(entity) + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}catch (Exception ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "add", "新增数据失败.DATA:" + JSONObject.toJSONString(entity) + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}

		return result;
	}

	/**
	 * 修改
	 */
	@RequestMapping(value = "/modify.do", method = { RequestMethod.POST })
	@ResponseBody
	public Object modify(HttpServletRequest request, HttpServletResponse response) throws BaseException {
		String id = request.getParameter("id");
		String contents = request.getParameter("contents");
		String sendday = request.getParameter("sendday");
		String sendhour = request.getParameter("sendhour");
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_UPDATE_SUCC);
		if(StringUtils.isEmpty(id)){
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_DATA_PK_IS_EMPTY);
			BaseLogUtils.info(logger, "modify", "修改数据,主键不存在.[id="+id+"]", CurrentThreadContext.getCurrentUserName());
			return result;
		}
		SysSmsLogVO entity = null;
		try {
			entity = new SysSmsLogVO();
			entity.setId(Long.valueOf(id));
			if(StringUtils.isNotEmpty(contents)){
				entity.setContents(contents);
			}
			if(StringUtils.isNotEmpty(sendday) && StringUtils.isNotEmpty(sendhour)){
				String senddate = sendday + " " + sendhour;
				entity.setSendDate(DateUtils.formatStringToDate(senddate,"yyyy-MM-dd HH:mm"));
			}
			//TODO ADD PARAM
			boolean success = this.sysSmsLogService.modify(entity);
			if(!success){
				result.setSuccess(BaseConstant.IS_YESNO_NO);
				result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
				BaseLogUtils.info(logger, "modify", "修改失败.[id="+id+"] DATA:" + JSONObject.toJSONString(entity), CurrentThreadContext.getCurrentUserName());
			}
			BaseLogUtils.info(logger, "modify", "修改成功.[id="+id+"] DATA:" + JSONObject.toJSONString(entity), CurrentThreadContext.getCurrentUserName());
		}catch (BaseException ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "modify", "修改失败.[id="+id+"] DATA:" + JSONObject.toJSONString(entity) + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}catch (Exception ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "modify", "修改失败.[id="+id+"] DATA:" + JSONObject.toJSONString(entity) + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}
		return result;
	}

	/**
	 * 重新发送
	 */
	@RequestMapping(value = "/againSendSMS.do", method = { RequestMethod.POST })
	@ResponseBody
	public Object againSendSMS(HttpServletRequest request, HttpServletResponse response) throws BaseException {
		String id = request.getParameter("id");
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, "发送成功");
		if(StringUtils.isEmpty(id)){
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_DATA_PK_IS_EMPTY);
			BaseLogUtils.info(logger, "againSendSMS", "修改数据,主键不存在.[id="+id+"]", CurrentThreadContext.getCurrentUserName());
			return result;
		}
		SysSmsLogVO vo = this.sysSmsLogService.selectById(Long.valueOf(id));

		SysSmsLogVO entity = null;
		try {
			String receive_phone = vo.getReceivePhone();
			String contents = vo.getContents();
			String send_task = vo.getSendTask();
			entity = new SysSmsLogVO();
			entity.setReceivePhone(receive_phone);
			entity.setContents(contents);
			entity.setSendTask(send_task);
			entity.setSendDate(new Date());
			entity.setCreateId(CurrentThreadContext.getCurrentUserId());
			entity.setCreateName(CurrentThreadContext.getCurrentUserName());
			//发送短信
			DataResultDTO sendres = this.sysSmsLogService.sendCcSms(entity);
			if (null == sendres || StringUtils.isEmpty(sendres.getCode()) || "0".equals(sendres.getCode())) { // 判断 短信状态
				result.setSuccess(BaseConstant.IS_YESNO_NO);
				result.setInfo("发送失败");
			}
			BaseLogUtils.info(logger, "againSendSMS", "重新发送成功.[id="+id+"] DATA:" + JSONObject.toJSONString(entity), CurrentThreadContext.getCurrentUserName());
		}catch (BaseException ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "againSendSMS", "重新发送失败.[id="+id+"] DATA:" + JSONObject.toJSONString(entity) + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}catch (Exception ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "againSendSMS", "重新发送失败.[id="+id+"] DATA:" + JSONObject.toJSONString(entity) + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}
		return result;
	}

	@RequestMapping(value = "/exportSmsExcel.do", method = {RequestMethod.POST, RequestMethod.GET})
	public void exportSmsExcel(HttpServletRequest request, HttpServletResponse response) {
		String sendDateBegin = request.getParameter("sendDateBegin"); //开始时间
		String sendDateEnd = request.getParameter("sendDateEnd"); //结束时间
		String receivePhone = request.getParameter("receivePhone"); //手机号
		String contents = request.getParameter("contents"); //短信内容
		String createName = request.getParameter("createName"); //创建人

		SysSmsLogQueryCondition qc = new SysSmsLogQueryCondition();
		if (StringUtils.isNotEmpty(sendDateBegin)) {
			qc.setSendDateBegin(DateUtils.formatStringToDate(sendDateBegin, "yyyy-MM-dd"));
		}
		if (StringUtils.isNotEmpty(sendDateEnd)) {
			qc.setSendDateEnd(DateUtils.formatStringToDate(sendDateEnd, "yyyy-MM-dd"));
		}
		if (StringUtils.isNotEmpty(receivePhone)) {
			qc.setReceivePhone(receivePhone);
		}
		if (StringUtils.isNotEmpty(contents)) {
			qc.setContents(contents);
		}
		if (StringUtils.isNotEmpty(createName)) {
			qc.setCreateName(createName);
		}
		qc.setSendTask("001");
		List<SysSmsLogVO> list = this.sysSmsLogService.searchList(qc);
		if(CollectionUtils.isNotEmpty(list)){
			this.setSysSmsLogVOWithDicInfo(list);//加入字典项名称
		}
		ExportParams params = new ExportParams("短信发送记录", "短信发送记录", ExcelType.HSSF);
		//HSSF是POI工程对Excel 97(-2007)文件操作的纯Java实现;
		//XSSF是POI工程对Excel 2007 OOXML (.xlsx)文件操作的纯Java实现
		//SXSSF基于XSSF的低内存占用的API
		params.setColor(HSSFColor.BRIGHT_GREEN.index);//表头颜色
		params.setStyle(ExcelExportStylerDefaultImpl.class);//ExcelExportStylerBorderImpl 有边框样式 ExcelExportStylerColorImpl  有边框间隔行样式 ExcelExportStylerDefaultImpl	默认的样式
		Workbook workbook = ExcelExportUtil.exportExcel(params, SysSmsLogVO.class, list);
		OutputStream ouputStream = null;
		try {
			String filename="短信发送记录";
			filename=new String(filename.getBytes("UTF-8"),"ISO8859-1");
			response.reset();
			response.setCharacterEncoding("utf-8");
			response.setHeader("Content-disposition", "attachment; filename=" + filename + ".xls");// 设定输出文件头
			response.setContentType("application/x-msdownload");// 定义输出类型
			ouputStream = response.getOutputStream();
			workbook.write(ouputStream);
			ouputStream.flush();
			ouputStream.close();
		} catch (UnsupportedEncodingException e) {
			BaseLogUtils.error(logger, "-", "异常", e);
		} catch (IOException e) {
			BaseLogUtils.error(logger, "-", "异常", e);
		}finally {
			//关闭流
			if(ouputStream!=null){
				try {
					ouputStream.close();
				} catch (IOException e) {
			BaseLogUtils.error(logger, "-", "异常", e);
				}
			}
		}

	}
	/**
	 * 解析excel
	 */
	@RequestMapping(value = "/sendPhone.do", method = { RequestMethod.POST })
	@ResponseBody
	public Object sendPhone(HttpServletRequest request, HttpServletResponse response) throws BaseException {
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_ADD_SUCC);
		String filePath = request.getParameter("filePath");
		if(StringUtils.isEmpty(filePath)){
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo("解析文件错误");
			BaseLogUtils.info(logger, "manualDetaiXls", "操作数据,解析文件路径为空!", CurrentThreadContext.getCurrentUserName());
			return result;
		}
		try {
			//同时支持Excel 2003、2007
			File excelFile=new File(PropertiesCacheUtils.getProperty(SysUlFilesRecConstant.SYS_FILE_UPLOAD_ROOT_PATH)+filePath);//创建文件对象
			FileInputStream is = new FileInputStream(excelFile); //文件流
			Workbook workbook = WorkbookFactory.create(is); //这种方式 Excel 2003/2007/2010 都是可以处理的
			Sheet sheet = workbook.getSheetAt(0);
			int rowCount = sheet.getPhysicalNumberOfRows(); //获取总行数
			StringBuffer sbf = new StringBuffer();
			for (int r = 1; r < rowCount; r++) { // 从第二行开始，去除第一行标题
				Row row = sheet.getRow(r);
				Cell cell = row.getCell(0);
				int cellType = cell.getCellType();
				String cellValue = "";
				switch(cellType) {
					case Cell.CELL_TYPE_STRING: //文本
						cellValue = cell.getStringCellValue();
						break;
					case Cell.CELL_TYPE_NUMERIC: //数字、日期
						double sss = cell.getNumericCellValue();
						DecimalFormat df = new DecimalFormat("#");
						cellValue = df.format(sss); //数字
						break;
					case Cell.CELL_TYPE_BLANK: //空白
						cellValue = cell.getStringCellValue();
						break;
					default:
						cellValue = "";
				}
				if(!"".equals(cellValue)){
					if(r==rowCount-1){
						sbf.append(cellValue);
					}else{
						sbf.append(cellValue).append(";");
					}
				}
			}
			result.setData(sbf.toString());
		}catch (BaseException ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "sendPhone", "导入手机号失败.ERROR:" + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}catch (Exception ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "sendPhone", "导入手机号失败,系统错误.ERROR:" + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}

		return result;
	}

	/**
	 * 解析excel
	 */
	@RequestMapping(value = "/bathSendSmsXls.do", method = { RequestMethod.POST })
	@ResponseBody
	public Object bathSendSmsXls(HttpServletRequest request, HttpServletResponse response) throws BaseException {
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_ADD_SUCC);
		String filePath = request.getParameter("filePath");
		if(StringUtils.isEmpty(filePath)){
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo("解析文件错误");
			BaseLogUtils.info(logger, "manualDetaiXls", "操作数据,解析文件路径为空!", CurrentThreadContext.getCurrentUserName());
			return result;
		}
		try {
			//同时支持Excel 2003、2007
			File excelFile=new File(PropertiesCacheUtils.getProperty(SysUlFilesRecConstant.SYS_FILE_UPLOAD_ROOT_PATH)+filePath);//创建文件对象
			FileInputStream is = new FileInputStream(excelFile); //文件流
			Workbook workbook = WorkbookFactory.create(is); //这种方式 Excel 2003/2007/2010 都是可以处理的
			Sheet sheet = workbook.getSheetAt(0);
			int rowCount = sheet.getPhysicalNumberOfRows(); //获取总行数
			StringBuffer sbf = new StringBuffer();
			for (int r = 1; r < rowCount; r++) { // 从第二行开始，去除第一行标题
				Row row = sheet.getRow(r);
				Cell cell = row.getCell(0);
				int cellType = cell.getCellType();
				String cellValue = "";
				switch(cellType) {
					case Cell.CELL_TYPE_STRING: //文本
						cellValue = cell.getStringCellValue();
						break;
					case Cell.CELL_TYPE_NUMERIC: //数字、日期
						double sss = cell.getNumericCellValue();
						DecimalFormat df = new DecimalFormat("#");
						cellValue = df.format(sss); //数字
						break;
					case Cell.CELL_TYPE_BLANK: //空白
						cellValue = cell.getStringCellValue();
						break;
					default:
						cellValue = "";
				}
				if(!"".equals(cellValue)){
					if(r==rowCount-1){
						sbf.append(cellValue);
					}else{
						sbf.append(cellValue).append(";");
					}
				}
			}
			result.setData(sbf.toString());
		}catch (BaseException ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "sendPhone", "导入手机号失败.ERROR:" + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}catch (Exception ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo("解析错误");
			BaseLogUtils.error(logger, "sendPhone", "导入手机号失败,系统错误.ERROR:" + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}

		return result;
	}

	/**
	 * 立即发送
	 */
	@RequestMapping(value = "/startSendSMS.do", method = { RequestMethod.POST })
	@ResponseBody
	public Object startSendSMS(HttpServletRequest request, HttpServletResponse response) throws BaseException {
		String phonelist = request.getParameter("phonelist");
		String contents = request.getParameter("content");
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, "发送完成");
		if(StringUtils.isEmpty(phonelist)){
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_DATA_PK_IS_EMPTY);
			BaseLogUtils.info(logger, "startSendSMS", "立即发送参数错误", CurrentThreadContext.getCurrentUserName());
			return result;
		}
		try {
			String[] phoneArray = phonelist.split(";"); // 按分号分隔手机号
			for (int i = 0; i < phoneArray.length; i++) { // 循环手机号数组
				SysSmsLogVO entity = new SysSmsLogVO();
				String receive_phone = phoneArray[i].trim();
				entity.setReceivePhone(receive_phone);
				entity.setContents(contents);
				entity.setSendTask("001");
				entity.setSendDate(new Date());
				entity.setCreateId(CurrentThreadContext.getCurrentUserId());
				entity.setCreateName(CurrentThreadContext.getCurrentUserName());
				//发送短信
				DataResultDTO sendres = this.sysSmsLogService.sendCcSms(entity);
				if (null == sendres || StringUtils.isEmpty(sendres.getCode()) || "0".equals(sendres.getCode())) { // 判断 短信状态
					BaseLogUtils.info(logger, "startSendSMS", "立即发送失败.DATA:" + JSONObject.toJSONString(entity), CurrentThreadContext.getCurrentUserName());
				}
			}
			BaseLogUtils.info(logger, "startSendSMS", "立即发送成功.", CurrentThreadContext.getCurrentUserName());
		}catch (BaseException ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "startSendSMS", "立即发送失败."+ ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}catch (Exception ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "startSendSMS", "立即发送失败." + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}
		return result;
	}
	/**
	 * 预约发送
	 */
	@RequestMapping(value = "/waitSendSms.do", method = { RequestMethod.POST })
	@ResponseBody
	public Object waitSendSms(HttpServletRequest request, HttpServletResponse response) throws BaseException {
		String phonelist = request.getParameter("phonelist");
		String contents = request.getParameter("content");
		String sendday = request.getParameter("sendday");
		String sendhour = request.getParameter("sendhour");
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, "发送完成");
		if(StringUtils.isEmpty(phonelist)){
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_DATA_PK_IS_EMPTY);
			BaseLogUtils.info(logger, "startSendSMS", "预约发送参数错误", CurrentThreadContext.getCurrentUserName());
			return result;
		}
		try {
			String[] phoneArray = phonelist.split(";"); // 按分号分隔手机号
			for (int i = 0; i < phoneArray.length; i++) { // 循环手机号数组
				SysSmsLogVO entity = new SysSmsLogVO();
				if(StringUtils.isNotEmpty(sendday) && StringUtils.isNotEmpty(sendhour)){
					String senddate = sendday + " " + sendhour;
					entity.setSendDate(DateUtils.formatStringToDate(senddate,"yyyy-MM-dd HH:mm"));
				}
				String receive_phone = phoneArray[i].trim();
				entity.setReceivePhone(receive_phone);
				entity.setContents(contents);
				entity.setSendTask("001");
				entity.setCreateId(CurrentThreadContext.getCurrentUserId());
				entity.setCreateName(CurrentThreadContext.getCurrentUserName());
				entity.setSmsStatus("0"); //待发送
				Long smsid = this.sysSmsLogService.add(entity);
				if (null == smsid) {
					BaseLogUtils.info(logger, "startSendSMS", "预约发送失败.DATA:" + JSONObject.toJSONString(entity), CurrentThreadContext.getCurrentUserName());
				}
			}
			BaseLogUtils.info(logger, "startSendSMS", "预约发送成功.", CurrentThreadContext.getCurrentUserName());
		}catch (BaseException ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "startSendSMS", "预约发送失败." + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}catch (Exception ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "startSendSMS", "预约发送失败." + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}
		return result;
	}
	/**
	 * 批量导入解析excel
	 */
	@RequestMapping(value = "/SendSmsConXls.do", method = { RequestMethod.POST })
	@ResponseBody
	public Object SendSmsConXls(HttpServletRequest request, HttpServletResponse response) throws BaseException {
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_ADD_SUCC);
		String filePath = request.getParameter("filePath");
		List<SysSmsLogVO> list = new ArrayList<SysSmsLogVO>();
		JSONObject datajson = new JSONObject();
		JSONArray array = new JSONArray();
		try {
			//同时支持Excel 2003、2007
			File excelFile=new File(PropertiesCacheUtils.getProperty(SysUlFilesRecConstant.SYS_FILE_UPLOAD_ROOT_PATH)+filePath);//创建文件对象
			FileInputStream is = new FileInputStream(excelFile); //文件流
			Workbook workbook = WorkbookFactory.create(is); //这种方式 Excel 2003/2007/2010 都是可以处理的
			Sheet sheet = workbook.getSheetAt(0);
			int rowCount = sheet.getPhysicalNumberOfRows(); //获取总行数

			for (int r = 1; r < rowCount; r++) { // 从第二行开始，去除第一行标题
				JSONObject jsob = new JSONObject();
				Row row = sheet.getRow(r);
				Cell cell = row.getCell(0);
				Cell cell1 = row.getCell(1);
				int cellType = cell.getCellType();
				int cellType1 = cell1.getCellType();
				String cellValue = "";
				String cell1Value = "";
				switch(cellType) {
					case Cell.CELL_TYPE_STRING: //文本
						cellValue = cell.getStringCellValue();
						break;
					case Cell.CELL_TYPE_NUMERIC: //数字、日期
						double sss = cell.getNumericCellValue();
						DecimalFormat df = new DecimalFormat("#");
						cellValue = df.format(sss); //数字
						break;
					case Cell.CELL_TYPE_BLANK: //空白
						cellValue = cell.getStringCellValue();
						break;
					default:
						cellValue = "";
				}
				jsob.put("receivePhone",cellValue);
				switch(cellType1) {
					case Cell.CELL_TYPE_STRING: //文本
						cell1Value = cell1.getStringCellValue();
						break;
					case Cell.CELL_TYPE_NUMERIC: //数字、日期
						double sss = cell1.getNumericCellValue();
						DecimalFormat df = new DecimalFormat("#");
						cell1Value = df.format(sss); //数字
						break;
					case Cell.CELL_TYPE_BLANK: //空白
						cell1Value = cell1.getStringCellValue();
						break;
					default:
						cell1Value = "";
				}
				jsob.put("contents",cell1Value);
				array.add(jsob);

			}
			datajson.put("Rows",array);
			result.setData(datajson);
		}catch (BaseException ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "sendPhone", "导入手机号失败.ERROR:" + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}catch (Exception ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo("解析错误");
			BaseLogUtils.error(logger, "sendPhone", "导入手机号失败,系统错误.ERROR:" + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}
		return result;
	}

	/**
	 * 批量立即发送
	 */
	@RequestMapping(value = "/batchStartSendSMS.do", method = { RequestMethod.POST })
	@ResponseBody
	public Object batchStartSendSMS(HttpServletRequest request, HttpServletResponse response) throws BaseException {
		String datalist = request.getParameter("datalist");
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, "发送完成");
		if(StringUtils.isEmpty(datalist)){
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_DATA_PK_IS_EMPTY);
			BaseLogUtils.info(logger, "startSendSMS", "立即发送参数错误", CurrentThreadContext.getCurrentUserName());
			return result;
		}
		try {
			JSONArray dataArray = JSONArray.parseArray(datalist);
			for (int i = 0; i < dataArray.size(); i++) { // 循环手机号数组
				JSONObject datajb = dataArray.getJSONObject(i);
				SysSmsLogVO entity = new SysSmsLogVO();
				String receive_phone = "";
				if(null != datajb.get("receivePhone")){
					receive_phone = datajb.getString("receivePhone").trim();
				}
				String contents = "";
				if(null != datajb.get("contents")){
					contents = datajb.getString("contents");
				}
				entity.setReceivePhone(receive_phone);
				entity.setContents(contents);
				entity.setSendTask("001");
				entity.setSendDate(new Date());
				entity.setCreateId(CurrentThreadContext.getCurrentUserId());
				entity.setCreateName(CurrentThreadContext.getCurrentUserName());
				//发送短信
				DataResultDTO sendres = this.sysSmsLogService.sendCcSms(entity);
				if (null == sendres || StringUtils.isEmpty(sendres.getCode()) || "0".equals(sendres.getCode())) { // 判断 短信状态
					BaseLogUtils.info(logger, "startSendSMS", "立即发送失败.DATA:" + JSONObject.toJSONString(entity), CurrentThreadContext.getCurrentUserName());
				}
			}
			BaseLogUtils.info(logger, "startSendSMS", "立即发送成功.", CurrentThreadContext.getCurrentUserName());
		}catch (BaseException ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "startSendSMS", "立即发送失败."+ ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}catch (Exception ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "startSendSMS", "立即发送失败." + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}
		return result;
	}
	/**
	 * 批量预约发送
	 */
	@RequestMapping(value = "/batchWaitSendSms.do", method = { RequestMethod.POST })
	@ResponseBody
	public Object batchWaitSendSms(HttpServletRequest request, HttpServletResponse response) throws BaseException {
		String datalist = request.getParameter("datalist");
		String sendday = request.getParameter("sendday");
		String sendhour = request.getParameter("sendhour");
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, "发送完成");
		if(StringUtils.isEmpty(datalist)){
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_DATA_PK_IS_EMPTY);
			BaseLogUtils.info(logger, "startSendSMS", "预约发送参数错误", CurrentThreadContext.getCurrentUserName());
			return result;
		}
		try {
			JSONArray dataArray = JSONArray.parseArray(datalist);
			for (int i = 0; i < dataArray.size(); i++) { // 循环手机号数组
				JSONObject datajb = dataArray.getJSONObject(i);
				SysSmsLogVO entity = new SysSmsLogVO();
				if(StringUtils.isNotEmpty(sendday) && StringUtils.isNotEmpty(sendhour)){
					String senddate = sendday + " " + sendhour;
					entity.setSendDate(DateUtils.formatStringToDate(senddate,"yyyy-MM-dd HH:mm"));
				}
				String receive_phone = "";
				if(null != datajb.get("receivePhone")){
					receive_phone = datajb.getString("receivePhone").trim();
				}
				String contents = "";
				if(null != datajb.get("contents")){
					contents = datajb.getString("contents");
				}
				entity.setReceivePhone(receive_phone);
				entity.setContents(contents);
				entity.setSendTask("001");

				Date nowdate = new Date();
				entity.setCreateId(CurrentThreadContext.getCurrentUserId());
				entity.setCreateName(CurrentThreadContext.getCurrentUserName());
				entity.setCreateDate(nowdate);
				entity.setSmsStatus("0"); //待发送
				Long smsid = this.sysSmsLogService.add(entity);
				if (null == smsid) {
					BaseLogUtils.info(logger, "startSendSMS", "预约发送失败.DATA:" + JSONObject.toJSONString(entity), CurrentThreadContext.getCurrentUserName());
				}
			}
			BaseLogUtils.info(logger, "startSendSMS", "预约发送成功.", CurrentThreadContext.getCurrentUserName());
		}catch (BaseException ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.info(logger, "startSendSMS", "预约发送失败." + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}catch (Exception ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.error(logger, "startSendSMS", "预约发送失败." + ex.getMessage(), CurrentThreadContext.getCurrentUserName());
		}
		return result;
	}
}

